<form class="form-inline" action="<?php echo base_url(); echo index_page(); ?>/main/search_result" method="post">
        <!-- form action should be redirect to the model that calculates the queries path -->
        <fieldset>
                <legend>Search Schedules</legend>
                
                <label>Movie Title</label> 
                <select name="movie" onload="document.getElementById('text_movie').value=this.options[this.selectedIndex].text"
                                onchange="document.getElementById('text_movie').value=this.options[this.selectedIndex].text">
                        <option>All</option>
                        <?php 
                                if(isset($queryMovie) && $queryMovie->num_rows() > 0) {
                                        $result = $queryMovie->result_array();
                                        foreach ($result as $row) {
                                                echo "<option>" . $row['title'] . "</option>";
                                        }
                                }
                                
                        ?>      
                        <input type="hidden" name="textMovie" id="text_movie" value="All" />
                </select> 
                
                <label>Theater</label> 
                <select name="theater" onload="document.getElementById('text_theater').value=this.options[this.selectedIndex].text"
                                onchange="document.getElementById('text_theater').value=this.options[this.selectedIndex].text">
                        <option>All</option>
                        <?php 
                                if(isset($queryTheater) && $queryTheater->num_rows() > 0) {
                                        $result = $queryTheater->result_array();
                                        foreach ($result as $row) {
                                                echo "<option>" . $row['name'] . " - " . $row['address'] . "</option>";
                                        }
                                }
                        ?>
                        <input type="hidden" name="textTheater" id="text_theater" value="All" />
                </select> 
                
                <label>Schedule</label> 
                <select name="date" onload="document.getElementById('text_date').value=this.options[this.selectedIndex].text"
                                onchange="document.getElementById('text_date').value=this.options[this.selectedIndex].text">
                        <option>All</option>
                        <?php 
                                if(isset($queryShowtime) && $queryShowtime->num_rows() > 0) {
                                        $result = $queryShowtime->result_array();
                                        foreach ($result as $row) {
                                                echo "<option>" . $row['date'] . " - " . $row['time'] . "</option>";
                                        }
                                }
                        ?>
                        <input type="hidden" name="textDate" id="text_date" value="All" />
                </select>

                <button type="submit" class="btn btn-large btn-inverse">
                        <i class="icon-search"></i>Search
                </button>
        </fieldset>
</form>